<?php

class PowerBarWith19PointsTest extends PHPUnit_Framework_TestCase {
	
	public function setUp() {
		$this->powerBar = OPPowerBar::newWithGoalAndNumberOfLevels(100, 5);
		$event = new OPLevelEvent();
		$this->powerBar->addEvent($event);
		
		$this->powerBar->increaseBy(19);
	
	}
	
	/**
	 * @test
	 */
	public function levelShouldBe2After1PointWinning() {
		$this->powerBar->increaseBy(1);
		$this->assertEquals(2, $this->powerBar->level());
		
	}
	
	/**
	 * @test
	 */
	public function levelShouldBe2After3PointsWinning() {
		$this->powerBar->increaseBy(3);
		$this->assertEquals(2, $this->powerBar->level());
		
	}
	
	/**
	 * @test
	 */
	public function increaseByShouldReturnAnEventAfter1PointWinning() {
		$this->assertInstanceOf('OPLevelEvent', $this->powerBar->increaseBy(1));
		
	}
	
}